home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 September
/
Ahoy_Magazine_87-09_1987_Double_L_Side_A.d64
/
Binary to GEOS
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
992b
|
38 lines
100 rem* binary to geos v1.0 from ahoy!!
110 rem* (e)ngendered by shawn k. smith
120 pn$="ps to geos":data 000,006,087,003,008,004,030
130 ford=1to16:p$=p$+chr$(160):next
140 pn$=mid$(pn$+p$,1,16):z$=chr$(0)
150 ford=1to7:read di(d):next
160 printchr$(147):print:print
170 input"enter name of binary file";b$
180 open1,8,15,"i0":open8,8,8,b$+",p,r"
190 gosub220:gosub250:gosub390
200 print:printchr$(18)pn$" converted!"
210 close8:close1:end
220 input#1,e,e$,a$,a$:ife=0thenreturn
230 print:print"***";e;e$;" ***"
240 close8:close1:end
250 print:print"working . . .":print
260 t=18:s=1:close8:open8,8,8,+"#"
270 print#1,"u1"8;0;t;s:gosub220
280 print#1,"b-p"8;0:get#8,nt$,ns$
290 fortb=2to228step32:dn$=""
300 print#1,"b-p"8;tb:get#8,ft$,td$,sd$
310 ifasc(ft$+z$)<>130then350
320 ford=1to16:get#8,n$:dn$=dn$+n$:next
330 printdn$,
340 if dn$=mid$(b$+p$,1,16)then return
350 next:t=asc(nt$+z$):s=asc(ns$+z$)
360 if t then270
370 print"??? file not found!"
380 close8:close1:end
390 print#1,"u1"8;0;asc(td$)asc(sd$)
400 print#1,"b-p"8;0:get#8,t2$,s2$
410 print#1,"b-p"8;0:print#8,chr$(0)chr$(255)chr$(3)chr$(21);
420 print#1,"u2"8;0;asc(td$)asc(sd$)
430 print#1,"u1"8;0;t;s:print#1,"b-p"8;tb:print#8,chr$(131);t2$s2$pn$td$sd$;
440 ford=1to7:print#8,chr$(di(d));:next
450 print#1,"u2"8;0;t;s
460 return